#!/bin/bash
# Run lkp benchmarks

###SHELLPACK preamble lkp-bench 0

###SHELLPACK parseargBegin
###SHELLPACK parseargInstall
###SHELLPACK parseargParam	--workload	LKP_WORKLOAD
###SHELLPACK parseargParam	--min-threads	LKP_MIN_THREADS
###SHELLPACK parseargParam	--max-threads	LKP_MAX_THREADS
###SHELLPACK parseargParam	--duration	LKP_DURATION
###SHELLPACK parseargParam	--iterations	LKP_ITERATIONS
###SHELLPACK parseargEnd
###SHELLPACK monitor_hooks

###SHELLPACK check_install_required lkp-${VERSION}
###SHELLPACK init_complete

echo $LKP_WORKLOAD > $LOGDIR_RESULTS/workload

###SHELLPACK threads_large_stride_begin $LKP_MIN_THREADS $LKP_MAX_THREADS
	export runtime=$LKP_DURATION
	export nr_threads=$NR_THREADS

	monitor_pre_hook $LOGDIR_RESULTS $NR_THREADS
	###SHELLPACK iteration_begin $LKP_ITERATIONS
	echo Starting $LKP_WORKLOAD threads $NR_THREADS/$LKP_MAX_THREADS iteration $ITERATION/$LKP_ITERATIONS
	./tests/$LKP_WORKLOAD 2>&1 | tee $LOGDIR_RESULTS/lkp-$NR_THREADS-$ITERATION.log
	###SHELLPACK iteration_end
	monitor_post_hook $LOGDIR_RESULTS $NR_THREADS
###SHELLPACK threads_stride_end

exit $SHELLPACK_SUCCESS
